<?php
/**
 * 登录模块
 * @copyright reginx.com
 * $Id: login.mod.php 49 2012-11-11 15:05:18Z reginx.com@gmail.com $
 */
class login_mod extends mod {
    
    /**
     * 登录
     *
     */
    public function indexAct(){
        if(isset($_POST['verify'])){
            if(!$this->vcode()){
                $this->showmsg('验证码错误' , null , true , 2);
            }
            $obj = core::getobj('admin_tab');
            if($obj->load('adm')){
                if(($row = $obj->chklogin()) != false){
                    $this->sobj->set('login' , $row);
                    $this->redirect('admin@index');
                }else{
                    $this->showmsg('帐号或密码错误' , null , 1 , 2);
                }
            }else{
                $this->showmsg($obj->geterr() , null , true , 2);
            }
        }
        $this->display('login.html');
    }
}
?>